package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateU8BaseDataDTO;
import com.itlong.cloud.POJO.VO.operate.OperateU8BaseDataCustomerVO;
import com.itlong.cloud.POJO.VO.operate.OperateU8BaseDataDepartmentVO;
import com.itlong.cloud.POJO.VO.operate.OperateU8BaseDataSalesVO;
import com.itlong.cloud.operate.service.IOperateU8BaseDataService;
import com.itlong.cloud.project.operate.IOperateU8BaseDataServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      运营-U8基础数据管理
 * </desc>
 *
 * @createDate 2020/12/02
 */
@RestController
public class OperateU8BaseDataServiceResource implements IOperateU8BaseDataServiceClient {
    @Autowired
    IOperateU8BaseDataService iOperateU8BaseDataService;

    /**
     * <desc>
     *      获取业务员部门列表
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2020/12/02
     */
    @Override
    @RequestMapping(path = "/operate/u8/baseData/getDepartmentPage")
    public Page<OperateU8BaseDataDepartmentVO> getDepartmentPage(@RequestBody OperateU8BaseDataDTO dto) throws Exception {
        return iOperateU8BaseDataService.getDepartmentPage(dto);
    }

    /**
     * <desc>
     *      获取业务员列表
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2020/12/02
     */
    @Override
    @RequestMapping(path = "/operate/u8/baseData/getSalesPage")
    public Page<OperateU8BaseDataSalesVO> getSalesPage(@RequestBody OperateU8BaseDataDTO dto) throws Exception {
        return iOperateU8BaseDataService.getSalesPage(dto);
    }

    /**
     * <desc>
     *      获取客户列表
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2020/12/02
     */
    @Override
    @RequestMapping(path = "/operate/u8/baseData/getCustomerPage")
    public Page<OperateU8BaseDataCustomerVO> getCustomerPage(@RequestBody OperateU8BaseDataDTO dto) throws Exception {
        return iOperateU8BaseDataService.getCustomerPage(dto);
    }

    /**
     * <desc>
     *      运营基础数据与U8同步定时任务
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2020/12/03
     */
    @Override
    @RequestMapping(path = "/operate/u8/baseDataBytime")
    public void timeTaskSynchronizeBaseDataByU8() throws Exception{
        iOperateU8BaseDataService.timeTaskSynchronizeBaseDataByU8();
    }

}
